package com.zhangtai.modules.service.salary;

import com.zhangtai.modules.entity.employee.EmployeeInfoEntity;
import com.zhangtai.modules.entity.salary.SalaryDistributionEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;


/**
 * 薪资组分配
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-09-21 17:34:24
 */

public interface SalaryDistributionService {

    @GetMapping("/findSalaryDistributionList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "keyword", required = false) String keyword,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    public List<Map<String,Object>> queryPageList(
            @RequestParam(value = "orgIds", required = false) List<Long> orgIds,
            @RequestParam(value = "orgId", required = false) List<Long> orgId,
            @RequestParam(value = "unitIds", required = false) List<Long> unitIds,
            @RequestParam(value = "jobIds", required = false) List<Long> jobIds,
            @RequestParam(value = "name", required = false) String name,
            @RequestParam(value = "code", required = false) String code,
            @RequestParam(value = "isDistribute", defaultValue = "0") Integer isDistribute,
            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    public SalaryDistributionEntity saveSalaryDistribution(
            EmployeeInfoEntity employeeInfoEntity, Integer type);

    @GetMapping("/infoSalaryDistribution")
    @ApiOperation(value = "根据id查找")
    SalaryDistributionEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/saveSalaryDistribution")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody SalaryDistributionEntity entity);

    @PostMapping("/updateSalaryDistribution")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody SalaryDistributionEntity entity);

    @GetMapping("/deleteOneSalaryDistribution")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteSalaryDistributions")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

